From 0669d8d6e955141e6d9801a5dce10cce061ce844 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Javier=20Jard=C3=B3n?= Date: Sat, 24 Apr 2010 05:37:14 +0200 Subject: [PATCH] Remove GtkText completely --- docs/reference/gtk/gtk-sections.txt | 31 ---- docs/reference/gtk/tmpl/gtktext.sgml | 238 --------------------------- examples/text/Makefile | 16 -- examples/text/text.c | 181 -------------------- gtk/gtk.symbols | 19 --- 5 files changed, 485 deletions(-) delete mode 100644 docs/reference/gtk/tmpl/gtktext.sgml delete mode 100644 examples/text/Makefile delete mode 100644 examples/text/text.c diff --git a/docs/reference/gtk/gtk-sections.txt b/docs/reference/gtk/gtk-sections.txt index 315b74c063..8f040522ec 100644 --- a/docs/reference/gtk/gtk-sections.txt +++ b/docs/reference/gtk/gtk-sections.txt @@ -3510,37 +3510,6 @@ GTK_TEAROFF_MENU_ITEM_GET_CLASS gtk_tearoff_menu_item_get_type -
-gtktext -GtkText -GtkText -GtkTextFont -GtkPropertyMark -gtk_text_new -gtk_text_set_editable -gtk_text_set_word_wrap -gtk_text_set_line_wrap -gtk_text_set_adjustments -gtk_text_set_point -gtk_text_get_point -gtk_text_get_length -gtk_text_freeze -gtk_text_thaw -gtk_text_insert -gtk_text_backward_delete -gtk_text_forward_delete -GTK_TEXT_INDEX - -GTK_TEXT -GTK_IS_TEXT -GTK_TYPE_TEXT -GTK_TEXT_CLASS -GTK_IS_TEXT_CLASS -GTK_TEXT_GET_CLASS - -gtk_text_get_type -
-
gtktextbuffer GtkTextBuffer diff --git a/docs/reference/gtk/tmpl/gtktext.sgml b/docs/reference/gtk/tmpl/gtktext.sgml deleted file mode 100644 index d4eb68eaf4..0000000000 --- a/docs/reference/gtk/tmpl/gtktext.sgml +++ /dev/null @@ -1,238 +0,0 @@ - -GtkText - - -A text widget - - - - - -#GtkText is deprecated and unsupported. It is known to be -buggy. To use it, you must define the symbol %GTK_ENABLE_BROKEN -prior to including the GTK+ header files. Use #GtkTextView instead. - - -A #GtkText widget allows one to display any given text and manipulate it -by deleting from one point to another, selecting a region, and various -other functions as outlined below. It is inherited from #GtkEditable. - - - - - - - - - - - - -Most of the #GtkText-struct struct members should not be accessed directly. -Listed below are a few exceptions and how to use them. - - - - - - - - -@text: the object which received the signal. -@arg1: -@arg2: - - - -Used by the #GtkText widget to keep track of the size of its horizontal -text. - - - - -Boolean value indicating whether line wrap is enabled or not. - - - - -Used by the #GtkText widget to keep track of the size of its vertical -text. - - - - -Boolean value indicated whether word wrap is enabled or not. - - - - -Internal #GtkText data type. - - - - - - -Internal #GtkText data type. Should not be accessed directly. - - - -@property: -@offset: -@index: - - - -Creates a new #GtkText widget, initialized with the given pointers to -#GtkAdjustments. These pointers can be used to track the viewing position -of the #GtkText widget. Passing %NULL to either or both of them will make -the #GtkText create its own. You can set these later with the function -gtk_text_set_adjustment(). - - -@hadj: horizontal adjustment. -@vadj: vertical adjustment. -@Returns: the new #GtkText widget. - - - - -Sets whether the #GtkText widget can be edited by the user or not. This -still allows you the programmer to make changes with the various #GtkText -functions. - - -@text: the #GtkText widget -@editable: %TRUE makes it editable, %FALSE makes it immutable by the user - - - - -Sets whether the #GtkText widget wraps words down to the next line if it -can't be completed on the current line. - - -@text: the #GtkText widget -@word_wrap: %TRUE makes it word wrap, %FALSE disables word wrapping - - - - -Controls how #GtkText handles long lines of continuous text. If line wrap -is on, the line is broken when it reaches the extent of the #GtkText widget -viewing area and the rest is displayed on the next line. If it is not set, -the line continues regardless size of current viewing area. Similar to word -wrap but it disregards word boundaries. - - -@text: the #GtkText widget -@line_wrap: %TRUE turns line wrap on, %FALSE turns it off - - - - -Allows you to set #GtkAdjustment pointers which in turn allows you to -keep track of the viewing position of the #GtkText widget. - - -@text: the #GtkText widget -@hadj: the horizontal adjustment -@vadj: the vertical adjustment - - - - -Sets the cursor at the given point. In this case a point constitutes -the number of characters from the extreme upper left corner of the #GtkText -widget. - - -@text: the #GtkText widget -@index: the number of characters from the upper left corner - - - - -Gets the current position of the cursor as the number of characters from -the upper left corner of the #GtkText widget. - - -@text: the #GtkText widget -@Returns: the number of characters from the upper left corner - - - - -Returns the length of the all the text contained within the #GtkText widget; -disregards current point position. - - -@text: the #GtkText widget -@Returns: the length of the text - - - - -Freezes the #GtkText widget which disallows redrawing of the widget until -it is thawed. This is useful if a large number of changes are going to -made to the text within the widget, reducing the amount of flicker seen -by the user. - - -@text: the #GtkText widget - - - - -Allows the #GtkText widget to be redrawn again by GTK. - - -@text: the #GtkText widget - - - - -Inserts given text into the #GtkText widget with the given properties as -outlined below. - - -@text: the #GtkText widget -@font: the #GdkFont to use -@fore: the foreground color to insert with -@back: the background color to insert with -@chars: the actual text to be inserted -@length: the length of the text to be inserted, passing -1 makes it insert -all the text. - - - - -Deletes from the current point position backward the given number of -characters. - - -@text: the #GtkText widget -@nchars: the number of characters to delete -@Returns: %TRUE if the operation was successful, otherwise returns %FALSE - - - - -Deletes from the current point position forward the given number of -characters. - - -@text: the #GtkText widget -@nchars: the number of characters to delete -@Returns: %TRUE if the operation was successful, otherwise returns %FALSE - - - - -Returns the character at the given index within the #GtkText widget. - - -@t: the #GtkText widget -@index: the number of characters from the upper left corner - - diff --git a/examples/text/Makefile b/examples/text/Makefile deleted file mode 100644 index 2632928f4a..0000000000 --- a/examples/text/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -CC = gcc - -#CFLAGS = -Wall \ -# -DG_DISABLE_DEPRECATED \ -# -DGDK_DISABLE_DEPRECATED \ -# -DGDK_PIXBUF_DISABLE_DEPRECATED \ -# -DGTK_DISABLE_DEPRECATED - -CFLAGS = - -text: text.c - $(CC) text.c -o text $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs` - -clean: - rm -f *.o text diff --git a/examples/text/text.c b/examples/text/text.c deleted file mode 100644 index 0b6c82574c..0000000000 --- a/examples/text/text.c +++ /dev/null @@ -1,181 +0,0 @@ - -#define GTK_ENABLE_BROKEN -#include "config.h" -#include -#include - -void text_toggle_editable (GtkWidget *checkbutton, - GtkWidget *text) -{ - gtk_text_set_editable (GTK_TEXT (text), - GTK_TOGGLE_BUTTON (checkbutton)->active); -} - -void text_toggle_word_wrap (GtkWidget *checkbutton, - GtkWidget *text) -{ - gtk_text_set_word_wrap (GTK_TEXT (text), - GTK_TOGGLE_BUTTON (checkbutton)->active); -} - -void close_application( GtkWidget *widget, - gpointer data ) -{ - gtk_main_quit (); -} - -int main( int argc, - char *argv[] ) -{ - GtkWidget *window; - GtkWidget *box1; - GtkWidget *box2; - GtkWidget *hbox; - GtkWidget *button; - GtkWidget *check; - GtkWidget *separator; - GtkWidget *table; - GtkWidget *vscrollbar; - GtkWidget *text; - GdkColormap *cmap; - GdkColor color; - GdkFont *fixed_font; - - FILE *infile; - - gtk_init (&argc, &argv); - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_size_request (window, 600, 500); - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (close_application), - NULL); - gtk_window_set_title (GTK_WINDOW (window), "Text Widget Example"); - gtk_container_set_border_width (GTK_CONTAINER (window), 0); - - - box1 = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (window), box1); - gtk_widget_show (box1); - - - box2 = gtk_vbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); - gtk_widget_show (box2); - - - table = gtk_table_new (2, 2, FALSE); - gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2); - gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2); - gtk_box_pack_start (GTK_BOX (box2), table, TRUE, TRUE, 0); - gtk_widget_show (table); - - /* Create the GtkText widget */ - text = gtk_text_new (NULL, NULL); - gtk_text_set_editable (GTK_TEXT (text), TRUE); - gtk_table_attach (GTK_TABLE (table), text, 0, 1, 0, 1, - GTK_EXPAND | GTK_SHRINK | GTK_FILL, - GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); - gtk_widget_show (text); - - /* Add a vertical scrollbar to the GtkText widget */ - vscrollbar = gtk_vscrollbar_new (GTK_TEXT (text)->vadj); - gtk_table_attach (GTK_TABLE (table), vscrollbar, 1, 2, 0, 1, - GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); - gtk_widget_show (vscrollbar); - - /* Get the system color map and allocate the color red */ - cmap = gdk_colormap_get_system (); - color.red = 0xffff; - color.green = 0; - color.blue = 0; - if (!gdk_color_alloc (cmap, &color)) { - g_error ("couldn't allocate color"); - } - - /* Load a fixed font */ - fixed_font = gdk_font_load ("-misc-fixed-medium-r-*-*-*-140-*-*-*-*-*-*"); - - /* Realizing a widget creates a window for it, - * ready for us to insert some text */ - gtk_widget_realize (text); - - /* Freeze the text widget, ready for multiple updates */ - gtk_text_freeze (GTK_TEXT (text)); - - /* Insert some colored text */ - gtk_text_insert (GTK_TEXT (text), NULL, &text->style->black, NULL, - "Supports ", -1); - gtk_text_insert (GTK_TEXT (text), NULL, &color, NULL, - "colored ", -1); - gtk_text_insert (GTK_TEXT (text), NULL, &text->style->black, NULL, - "text and different ", -1); - gtk_text_insert (GTK_TEXT (text), fixed_font, &text->style->black, NULL, - "fonts\n\n", -1); - - /* Load the file text.c into the text window */ - - infile = fopen ("text.c", "r"); - - if (infile) { - char buffer[1024]; - int nchars; - - while (1) - { - nchars = fread (buffer, 1, 1024, infile); - gtk_text_insert (GTK_TEXT (text), fixed_font, NULL, - NULL, buffer, nchars); - - if (nchars < 1024) - break; - } - - fclose (infile); - } - - /* Thaw the text widget, allowing the updates to become visible */ - gtk_text_thaw (GTK_TEXT (text)); - - hbox = gtk_hbutton_box_new (); - gtk_box_pack_start (GTK_BOX (box2), hbox, FALSE, FALSE, 0); - gtk_widget_show (hbox); - - check = gtk_check_button_new_with_label ("Editable"); - gtk_box_pack_start (GTK_BOX (hbox), check, FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (check), "toggled", - G_CALLBACK (text_toggle_editable), text); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE); - gtk_widget_show (check); - check = gtk_check_button_new_with_label ("Wrap Words"); - gtk_box_pack_start (GTK_BOX (hbox), check, FALSE, TRUE, 0); - g_signal_connect (G_OBJECT (check), "toggled", - G_CALLBACK (text_toggle_word_wrap), text); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE); - gtk_widget_show (check); - - separator = gtk_hseparator_new (); - gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0); - gtk_widget_show (separator); - - box2 = gtk_vbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0); - gtk_widget_show (box2); - - button = gtk_button_new_with_label ("close"); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (close_application), - NULL); - gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); - gtk_widget_set_can_default (button, TRUE); - gtk_widget_grab_default (button); - gtk_widget_show (button); - - gtk_widget_show (window); - - gtk_main (); - - return 0; -} diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index 68eedc1374..f8c0d8d749 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -3286,25 +3286,6 @@ gtk_text_tag_table_remove #endif #endif -#if IN_HEADER(__GTK_TEXT_H__) -#if IN_FILE(__GTK_TEXT_C__) -gtk_text_backward_delete -gtk_text_forward_delete -gtk_text_freeze -gtk_text_get_length -gtk_text_get_point -gtk_text_get_type G_GNUC_CONST -gtk_text_insert -gtk_text_new -gtk_text_set_adjustments -gtk_text_set_editable -gtk_text_set_line_wrap -gtk_text_set_point -gtk_text_set_word_wrap -gtk_text_thaw -#endif -#endif - #if IN_HEADER(__GTK_TEXT_BUFFER_H__) #if IN_FILE(__GTK_TEXT_BUFFER_C__) gtk_text_buffer_add_selection_clipboard -- 2.30.2